import logging

from config import BASE_HOST


class TenderApi:

    def __init__(self,ses):
        # 获取session对象
        self.ses = ses
    # 投资接口
    def tender(self,id_v,amount_v):
        url=BASE_HOST+'/trust/trust/tender'
        form_data={
            "id": id_v,
            "depositCertificate": -1 ,
            "amount": amount_v
        }
        resp = self.ses.post(url=url,data=form_data)
        logging.info(f'获取投资接口的响应数据：{resp.json()}')
        return resp
    # 第三方投资接口
    def third_tender(self,url,form_data):
        resp=self.ses.post(url=url,data=form_data)
        logging.info(f'获取投资接口的响应数据：{resp.text}')
        return resp
